<html>
	<head>
		<base href="<?php echo base_url() ?>"/>
		<title><?php echo $judul; ?> | Domba Garut Online</title>
		<link rel="stylesheet" href="css/style.css"  type="text/css" />
		<link rel="stylesheet" href="css/smoothness/jquery-ui-1.8.6.custom.css" />
		<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
		<script type="text/javascript" src="js/jquery-ui-1.8.6.custom.min.js"></script>
		<script type="text/javascript" src="js/jquery.validate.js"></script>
		<script type="text/javascript">
			// form registrasi
			$(function() {
				$("#form1").validate({
					rules: {
						input_namalengkap: "required",
						input_umur: {
							required: true,
							number: true,
							maxlength: 2
						},
						input_username: {
							required: true,
							minlength: 3,
							maxlength: 10
						},
						input_password: {
							required: true,
							minlength: 5
						},
						input_password2: {
							required: true,
							minlength: 5
						},
						input_password3: {
							required: true,
							equalTo: "#password2"
						},
						input_email: {
							required: true,
							email: true
						},
						input_telp: {
							required: true,
							number: true
						},
						input_pekerjaan: "required",
						input_tempatlahir: "required",
						input_tgllahir: {
							required: true,
							date: true
						},
						input_alamat: "required",
						input_bank: "required",
						input_rekening: {
							required: true,
							number: true
						},
						input_atas_nama: "required"
					},

					messages: {
						input_namalengkap: {
							required: '. Nama harus di isi'
						},
						input_umur: {
							required: '. Umur harus di isi',
							number  : '. Hanya boleh di isi Angka',
							maxlength: '. Hanya boleh 2 karakter'
						},
						input_username: {
							required: '. Username harus di isi',
							minlength: '. Username minimal 3 karakter',
							maxlength: '. Username maximal 10 karakter'
						},
						input_password: {
							required : '. Password harus di isi',
							minlength: '. Password minimal 5 karakter'
						},
						input_password2: {
							required : '. Password harus di isi',
							minlength: '. Password minimal 5 karakter'
						},
						input_password3: {
							required: '. Ulangi Password harus di isi',
							equalTo : '. Harus sama dengan Password'
						},
						input_email: {
							required: '. Email harus di isi',
							email   : '. Email harus valid'
						},
						input_telp: {
							required: '. Nomor telepon harus di isi',
							number	: '. Hanya boleh di isi angka'
						},
						input_tempatlahir: {
							required: '. Tempat lahir harus di isi'
						},
						input_tgllahir: {
							required: '. Tanggal lahir harus di isi',
							date: '. Format yang benar adalah yyyy-mm-dd'
						},
						input_pekerjaan: {
							required: '. Pekerjaan harus di isi',
						},
						input_alamat: {
							required: '. Alamat harus di isi',
						},
						input_bank: {
							required: '. Nama bank harus di isi',
						},
						input_rekening: {
							required: '. No. Rekening harus di isi',
							number: '. Hanya boleh di isi angka',
						},
						input_atas_nama: {
							required: '. Nama harus di isi',
						},
					},

					success: function(label) {
						label.text('OK!').addClass('valid');
					}
				});
			});

			// button form login
			$(function(){
				$("#dialog").dialog({
					autoOpen: false,
					resizable: false,
					draggable: false,
					modal: true
				});
				$(".create-user").click(function() {
					$("#dialog").dialog('open');
				});
			});
			
			// disable cara pembayaran
			$(function() {
				$('.form_cara_pembayaran :input').attr('disabled', true);
			});
			function EnableCod() {
				$('.form_cara_pembayaran :input').attr('disabled', true);
			}
			function EnableTransfer() {
				$('.form_cara_pembayaran :input').removeAttr('disabled');
			}
		</script>
	</head>
	
	<body>
		<div id="layout">
			
			<div class="header">
				<?php $this->load->view('header') ?>
			</div>

			<div class="konten">

				<div class="konten_kiri">
					<?php $this->load->view('konten_kiri') ?>
					<div class="clear"></div>
				</div>
				
				<div class="konten_kanan">
					<?php $this->load->view($template_konten) ?>
					<div class="clear"></div>
				</div>
				
				<div class="clear"></div>
				
			</div>

			<div class="footer">
				<?php $this->load->view('footer') ?>
			</div>
			
		</div>
		
	</body>
</html>
